package edu.object_oriented.poly;
//游戏
public class Game {

    String name;

    void play(){
        System.out.println("玩"+ name + "游戏");
    }

}
//电脑游戏
class ComputerGame extends Game{
    @Override
    void play() {
        System.out.println("使用键盘鼠标玩游戏");
    }
}

class MobileGame extends Game{
    @Override
    void play() {
        System.out.println("使用手机玩游戏");
    }

    void gamePlay(){

    }

}
class GameDao{
    //玩游戏
    void playGame(Game game){
        game.play();
    }

    public static void main(String[] args) {
        GameDao dao = new GameDao();
//        game可以指向不同的类型  多态
//        Game game = new Game();
//        Game game = new ComputerGame();
        Game game = new MobileGame();
        game.name = "吃鸡";
        dao.playGame(game);
    }

}





